package homeworkplus.day01;

/**
 * @Classname: Test03
 * @Author: bromide
 * @CreateTime: 2022/3/29--19:30
 * @Version: V1.0
 * @Desciption: 检查一个字符串是否为回文
 * 回文:正着念与反着念一样，例如:上海自来水来自海上
 */
public class Test03 {
    public static void main(String[] args) {
        String s = "上海自来水来自海上";
        System.out.println(check(s));
    }


    public static boolean check(String s) {
        StringBuilder s1 = new StringBuilder(s);
        String s2 = s1.reverse().toString();
        return s.equals(s2);
    }
}
